﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

namespace AirLine.DataAccess
{
    public interface IRepository
    {
        IEnumerable<T> Get<T>(Expression<Func<T, bool>> filter = null,
                                           Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null,
                                           string includeProperties = "") where T : class;

        T GetById<T>(int id) where T : class;
        IEnumerable<T> GetAll<T>() where T : class;
        bool Update<T>(T t) where T : class;
        bool Add<T>(T t) where T : class;
        bool Delete<T>(T t) where T : class;
        void AddWithOutCommit<T>(T t) where T : class;
        void Commit();
    }
}
